#ifndef DOCUMENTCOLLECTION_H
#define DOCUMENTCOLLECTION_H

#include <QList>
#include <QMultiMap>

#include "document.h"

class DocumentCollection : public QList<Document>
{
public:
    DocumentCollection();
    DocumentCollection(const QString &indexFile);
    const Document &document(const QString &docName);
    bool exists(const QString &docName) {return docNames.contains(docName);}
    void index(const QString &docDir, const QString &indexFile);
    void saveIndexToFile(const QString &file) const;
    QMultiMap<double, QString> findSimilar(const Document &doc);      // returns <score, document name>

private:
    QList<QString> docNames;
};

#endif // DOCUMENTCOLLECTION_H
